package com.decent.common.entity.common;

import lombok.Data;
import lombok.ToString;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Update;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

import java.math.BigDecimal;

/**
 * @author: decent Gjh
 * @date: 2022/10/25/17:51
 * @description:
 */
@Data
@ToString
public class Goods {

    /**
     * 商品id
     */
    @NotNull(message = "请输入商品id ", groups = {Update.class, Delete.class})
    private Integer id;
    /**
     * 商品名称
     */
    @NotEmpty(message = "商品名称不能为空 ", groups = {Update.class, Insert.class})
    private String name;

    /**
     * 品牌id
     */
    @NotNull(message = "品牌id不能为null",groups = {Update.class, Insert.class})
    private Integer brandId;

    /**
     * 商品编码
     */
    @NotEmpty(message = "商品编码不能为空", groups = {Update.class, Insert.class})
    private String code;

    /**
     * 商品描述
     */
    @NotEmpty(message = "商品描述不能为空", groups = {Update.class, Insert.class})
    private String introduce;

    /**
     * 商品图片链接
     */
    @NotEmpty(message = "商品图片链接不能为空")
    private String imageUrl;

    /**
     * 现价
     */
    @NotNull(message = "现价不能为空", groups = {Update.class, Insert.class})
    private BigDecimal presentPrice;

    /**
     * 原价
     */
    @NotNull(message = "原价不能为空", groups = {Update.class, Insert.class})
    private BigDecimal originalPrice;

    /**
     * 库存
     */
    @NotNull(message = "库存不能为null", groups = {Update.class, Insert.class})
    private Integer stock;

    /**
     * 销量
     */
    private Integer sales;


}
